#include"NamedPipe.hpp"
int main()
{
    NamedPipe fifo(path,gCreater);
    if(fifo.OpenForRead())
    {
        std::cout<<"server open namepipe done ... "<<std::endl;
        while(true)
        {
            std::string message;
            int n=fifo.ReadNamePipe(&message);
            if(n>0)
            std::cout<<message<<std::endl;
            else if(n==0)
            {
                std::cout<<"读端关闭，读到结尾"<<std::endl;
                break;
            }
            else 
            {
                std::cout<<"read error"<<std::endl;
                break;
            }
        }
    }
    return 0;
}